<?php
include_once("./Db_pdo.class.php");
require('./sql/s.php');//引入类
set_time_limit(0);
ini_set('date.timezone','Asia/Shanghai');
// $DB=new Db_pdo("jmshop","root","root");
//$DB=new Db_pdo("cxh_v3_test","cxhv3","cxhv3pwd!@#");
$DB=new Db_pdo("cxh_v3","cxhv3","cxhv3pwd!@#");
//$DB=new Db_pdo("jmft_cxh","root","123456");
// // echo '<pre>';
// $sql = 'select id from ims_ewei_shop_member limit 2000,3000';
//  $data= $DB->new_query($sql);
// $data = $data->fetchAll(PDO::FETCH_ASSOC);  
// //  $pass_agent = $DB->table("ims_ewei_shop_member")->field('id')->limit(584)->select();
// // print_r($data);
// // exit;
// foreach($data as $key =>$v){
//     $param = md5(uniqid());
//     $sqls = "update ims_ewei_shop_member set member_uuid = '".$param."' where id=".$v['id'];
//     //echo $sql;
// //    echo '<br>';
//    $DB->db->query($sqls);
// }


 
// $sqls = 'SELECT
// id,member_uuid,openid
// FROM
// ims_ewei_shop_member';
// $data= $DB->new_query($sqls);
// $data = $data->fetchAll(PDO::FETCH_ASSOC);


// foreach ($data as $key => $value) {
// 	//$sql1 ="update ims_cxh_user_ex set member_uuid ='".$value['member_uuid']."' WHERE member_id = ".$value['id']; 
// 	// $sql1 ="update ims_cxh_user_cash set member_uuid ='".$value['member_uuid']."' WHERE member_id = ".$value['id']; 
// 	//$sql1 ="update ims_cxh_apply_subsidy_car set member_uuid ='".$value['member_uuid']."' WHERE member_id = ".$value['id']; 
// 	// $sql1 ="update ims_cxh_apply_subsidy_agent set member_uuid ='".$value['member_uuid']."' WHERE member_id = ".$value['id']; 
// 	//$sql1 ="update ims_cxh_cash_log set member_uuid ='".$value['member_uuid']."' WHERE member_id = ".$value['id']; 
// 	// $sql1 ="update ims_ewei_shop_member_address set member_uuid ='".$value['member_uuid']."' WHERE openid = '".$value['openid']."'"; 
// 	// $sql1 ="update ims_cxh_apply_subsidy_back set member_uuid ='".$value['member_uuid']."'  WHERE member_id = ".$value['id']; 
// 	// $sql1 ="update ims_cxh_apply_subsidy_things set member_uuid ='".$value['member_uuid']."'  WHERE member_id = ".$value['id']; 
// 	//$sql1 ="update ims_cxh_stock_option set member_uuid ='".$value['member_uuid']."'  WHERE member_id = ".$value['id']; 
// 	// $sql1 ="update ims_cxh_transfer_record set member_uuid ='".$value['member_uuid']."'  WHERE member_id = ".$value['id']; 
// 	// $sql1 ="update ims_cxh_user_bank set member_uuid ='".$value['member_uuid']."'  WHERE member_id = ".$value['id']; 
// 	// $sql1 ="update ims_cxh_user_log set member_uuid ='".$value['member_uuid']."'  WHERE member_id = ".$value['id']; 
	
// 	// echo $sql1;
// 	// echo '<br>';
// 	//$DB->db->query($sql1);
// }


// $sqls ="
// SELECT
// 	*, FROM_UNIXTIME(ctime)
// FROM
// 	ims_cxh_cash_log
// WHERE ctime >=1548462222
// and ctime <=1548469502
// and cash_bus_type !=50
// and cash_bus_type !=1
// and cash_bus_type !=51
// and cash_bus_id not in(599034,599035)
// and cash_type =2
// and remark like '%扣除平台维护费'
// ORDER BY
// 	ctime DESC

// ";
// // echo $sqls;
// // exit;
// $data= $DB->new_query($sqls);
// $data = $data->fetchAll(PDO::FETCH_ASSOC);

//  print_r($data);
// foreach($data as $key){
//     // $sql ="update ims_cxh_apply_subsidy_back set ctime =".$key['ctime'].",member_id =".$key['member_id'] ." where id =".$key['cash_bus_id'];
//     // // echo $sql;
//     // // echo '<br>';
//     // $DB->db->query($sql);
// }

// echo '<pre>';

// $sql = "SELECT * FROM ims_cxh_user_cash WHERE ctime <1548416705 and uch_status =0";

// $data= $DB->new_query($sql);
// $data = $data->fetchAll(PDO::FETCH_ASSOC);

// foreach($data as $k){
//     $updatesql = "update ims_cxh_user_cash set uch_credit2=".$k['uch_money']." where id=".$k['id'];
//         // echo $updatesql;
//         // echo '<br>';
//         $DB->db->query($updatesql);
// }
// print_r($data);
















